/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package biofilter.records;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author qvh
 */
public class BlastTabRecordTest {

    public BlastTabRecordTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    String line = null;
    @Before
    public void setUp() {
        line = "HWI-EAS128_2_6_1_237_354	gi|125972525|ref|NC_009012.1|	96.77	31	1	0	1	31	2817665	2817635	5e-09	54.0\n";

    }

    @After
    public void tearDown() {
    }

    /**
     * Test of get method, of class BlastTabRecord.
     */
    @Test
    public void testGet() {
        System.out.println("get");
        BlastTabRecord instance = new BlastTabRecord(line);
        String result = instance.get();
        assertEquals(line, result);
    }

    /**
     * Test of set method, of class BlastTabRecord.
     */
    @Test
    public void testSet() {
        System.out.println("set");
        String r = "";
        BlastTabRecord instance = new BlastTabRecord(line);
        instance.set(r);
    }

    /**
     * Test of getStart method, of class BlastTabRecord.
     */
    @Test
    public void testGetStart() {
        System.out.println("getStart");
        BlastTabRecord instance = new BlastTabRecord(line);
        int expResult = 2817665;
        int result = instance.getStart();
        assertEquals(expResult, result);
    }

    /**
     * Test of getQueryStart method, of class BlastTabRecord.
     */
    @Test
    public void testGetQueryStart() {
        System.out.println("getQueryStart");
        BlastTabRecord instance = new BlastTabRecord(line);
        int expResult = 1;
        int result = instance.getQueryStart();
        assertEquals(expResult, result);
    }

    /**
     * Test of getEnd method, of class BlastTabRecord.
     */
    @Test
    public void testGetEnd() {
        System.out.println("getEnd");
        BlastTabRecord instance = new BlastTabRecord(line);
        int expResult = 2817635;
        int result = instance.getEnd();
        assertEquals(expResult, result);

    }

    /**
     * Test of getQueryEnd method, of class BlastTabRecord.
     */
    @Test
    public void testGetQueryEnd() {
        System.out.println("getQueryEnd");
        BlastTabRecord instance = new BlastTabRecord(line);
        int expResult = 31;
        int result = instance.getQueryEnd();
        assertEquals(expResult, result);
    }

    /**
     * Test of length method, of class BlastTabRecord.
     */
    @Test
    public void testLength() {
        System.out.println("length");
        BlastTabRecord instance = new BlastTabRecord(line);
        int expResult = 31;
        int result = instance.length();
        assertEquals(expResult, result);
    }

    /**
     * Test of getStrand method, of class BlastTabRecord.
     */
    @Test
    public void testGetStrand() {
        System.out.println("getStrand");
        BlastTabRecord instance = new BlastTabRecord(line);
        char expResult = '-';
        char result = instance.getStrand();
        assertEquals(expResult, result);
    }

    /**
     * Test of getWeight method, of class BlastTabRecord.
     */
    @Test
    public void testGetWeight() {
        System.out.println("getWeight");
        BlastTabRecord instance = new BlastTabRecord(line);
        double expResult = 54.0;
        double result = instance.getWeight();
        assertEquals(expResult, result, 0.0);
    }

    /**
     * Test of getQueryID method, of class BlastTabRecord.
     */
    @Test
    public void testGetQueryID() {
        System.out.println("getQueryID");
        BlastTabRecord instance = new BlastTabRecord(line);
        String expResult = "HWI-EAS128_2_6_1_237_354";
        String result = instance.getQueryID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getSubjectID method, of class BlastTabRecord.
     */
    @Test
    public void testGetSubjectID() {
        System.out.println("getSubjectID");
        BlastTabRecord instance = new BlastTabRecord(line);
        String expResult = "gi|125972525|ref|NC_009012.1|";
        String result = instance.getSubjectID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getEvalue method, of class BlastTabRecord.
     */
    @Test
    public void testGetEvalue() {
        System.out.println("getEvalue");
        BlastTabRecord instance = new BlastTabRecord(line);
        String expResult = "5e-09";
        String result = instance.getEvalue();
        assertEquals(expResult, result);
    }

}